import request from '@/utils/request'

// 获取检验批
export function getIpqcInspectionlotInfo(id) {
    return request({
        url: `/api/Business/IpqcInspectionlot/${id}`,
        method: 'GET'
    })
}

// 获取检验批列表
export function getIpqcInspectionlotList(data) {
    return request({
        url: `/api/Business/IpqcInspectionlot`,
        method: 'GET',
        data
    })
}

// 获取检验批检验项目数据
export function getIpqcInspectionitemList(code) {
    return request({
        url: `/api/Business/IpqcInspectionitem/${code}`,
        method: 'GET'
    })
}
// 保存检验数据
export function saveIpqcInspectionlot(data) {
    return request({
        url: '/api/Business/IpqcInspectionlot',
        method: 'PUT',
        data
    })
}
// 提交检验数据
export function submitIpqcInspectionlot(data) {
    return request({
        url: '/api/Business/IpqcInspectionlot',
        method: 'POST',
        data
    })
}

export function getFastReport(id) {
    return request({
      url: `/api/business/IpqcInspectionlot/fastreportIpqcInspectionlot/${id}`,
      method: 'get',
      responseType: 'arraybuffer'
    })
  }
  
// 修改抽样数量
export function updateSamplingQty(data) {
    return request({
        url: `/api/Business/IpqcInspectionitem/SamplingQty`,
        method: 'PUT',
        data
    })
}

// 批量删除检验项目
export function delIpqcInspectionitemBatch(data) {
    return request({
        url: `/api/Business/IpqcInspectionitem/batchRemove`,
        method: 'POST',
        data
    })
}

// 新增检验项目
export function addIpqcInspectionitem(data) {
    return request({
        url: `/api/Business/IpqcInspectionitem/addItem`,
        method: 'POST',
        data
    })
}

// 关闭检验批
export function closeIpqcInspectionlot(data) {
    return request({
        url: '/api/Business/IpqcInspectionlot/close',
        method: 'POST',
        data
    })
}